<?php

/*
 * class action for view users
 * @author Chamara Bandara
 * @copyright Copyright &copy; 2011 Allion Technologies (Pvt) Ltd
 */


class ViewAction extends CAction{
    
    public function run(){
        
        
        $contoller =  $this->getController();
        $contoller->render('view',array(
			'model'=>$this->loadModel($_GET['id']),
		));
      
    }
    
     
   protected function loadModel($id)
	{
	
        $model=User::model()->findByPk($id);
              	if($model===null)
			throw new CHttpException(404,'The requested page does not exist.');
		return $model;
	}
}